package irio.gamer;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JPanel;

import utils.Vec;

import Logic.Movie;

public class MoviePanel extends JPanel{
	public static DefaultListModel list = new DefaultListModel();
	Movie movie = new Movie();

	
	public void SetupTestMovie() {

		Vec v = new Vec();
		v.set(gamer.rp.camera);
		int N = 10;
		gamer.rp.up.set(1,0,0);
		gamer.rp.camera.set(4,4,-5);
		movie.AddCurrent(N);
		gamer.rp.camera.set(0,0,-4);
		movie.AddCurrent(N);
		gamer.rp.camera.set(0,-6, 0);
		movie.AddCurrent(N);
		gamer.rp.camera.set(3,-4,-3);
		movie.AddCurrent(N);

		gamer.rp.camera.set(v);
	}
	
	
	public MoviePanel() {

		setLayout(new GridLayout(2,2));
		
		JButton btnRun = new JButton("Create movie");
		btnRun.addActionListener(new ActionListener() {
			
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				SetupTestMovie();
				movie.StartRendering();
				
			}
		});
		add(btnRun);
		
	}
	
	
}
